package com.qbw.app.module.common.view;

import android.content.Context;
import androidx.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;

import com.lib.util.ScreenUtil;

/**
 * Author：qbw on 2019/3/22 17:16
 * 状态栏占位符，动态调整高度（适配那些全面屏的）
 */
public class StatusBarPlaceHolderView extends View {

    public StatusBarPlaceHolderView(Context context) {
        super(context);
    }

    public StatusBarPlaceHolderView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public StatusBarPlaceHolderView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int sh = ScreenUtil.getStatusHeight(getContext());
        super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(sh, MeasureSpec.EXACTLY));
    }
}
